#include <QtGui/QApplication>
#include "mainwindow.h"
#include "partie.h"
#include <iostream>


using namespace std;


int main(int argc, char *argv[])
{
   QApplication a(argc, argv);
    MainWindow w;
    w.show();

    QString noms[6];

    noms[0] = QString("Jack");
    noms[1] = QString("Joe");
    noms[2] = QString("Jimmy");
    noms[3] = QString("Jason");
    noms[4] = QString("Joseph");
    noms[5] = QString("Jarrod");

    Partie* jeu = new Partie(noms, 6);

    jeu->remplirVoisins();

    Emplacements* temp;

/* */
    for(int i = 0; i < 17; i++)
    {
        foreach (temp,jeu->m_plateau.values(i))
        {
            std::cout << temp->m_numero << "-";
        }
        cout << endl;

    }

/* */

    cout << endl;

    cout << endl;

/* * /
    for(int i = 0; i < 17; i++)
    {
        foreach (temp,jeu->m_plateau.values(i))
        {
            std::cout << temp->m_numero << "\n";

            for(int i = 0; i < 6; i++)
            {
                if(temp->m_voisins[i] == NULL) continue;

                char* jack;

                if(i == GAUCHE)
                    jack = "Gauche";
                else if(i == HAUTGAUCHE)
                    jack = "Haut Gauche";
                else if(i == HAUTDROITE)
                    jack = "Haut Droite";
                else if(i == DROITE)
                    jack = "Droite";
                else if(i == BASDROITE)
                    jack = "Bas Droite";
                else if(i == BASGAUCHE)
                    jack = "Bas Gauche";


                std::cout << "Voisin " << jack << " : " << temp->m_voisins[i]->m_numero << "-\n";

            }
        }

        cout << endl;
    }

/* */


    for(int i = 0; i < 17; i++)
    {
        foreach (temp,jeu->m_plateau.values(i))
        {
            temp->setZoneAndPlayer(jeu->m_nbjoueurs, 0, jeu->m_setdix);
        }

    }
/* * /
    for(int i = 0; i < 17; i++)
    {
        foreach (temp,jeu->m_plateau.values(i))
        {
            std::cout << temp->m_numero << "  --  " << temp->m_numjoueur << "  --  " << temp->m_zone << endl;
        }
        cout << endl;

    }
    cout << endl;
/* */

    for(int i = 0; i < 17; i++)
    {
        foreach (temp,jeu->m_plateau.values(i))
        {

            std::cout << temp->m_numjoueur << "  ";
        }
        cout << endl;

    }
    cout << endl;

    jeu->deplacerPiece(jeu->m_plateau.values(14).at(2), jeu->m_plateau.values(12).at(6));
    jeu->deplacerPiece(jeu->m_plateau.values(13).at(3), jeu->m_plateau.values(12).at(8));
    jeu->deplacerPiece(jeu->m_plateau.values(13).at(2), jeu->m_plateau.values(11).at(5));

    for(int i = 0; i < 17; i++)
    {
        foreach (temp,jeu->m_plateau.values(i))
        {

            std::cout << temp->m_numjoueur << "  ";
        }
        cout << endl;

    }


    cout << endl;

    return a.exec();
}
